<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/public/head.jsp" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>会员钱包后台管理系统</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="${system}/static/favicon.ico">
    <link href="${system}/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${system}/static/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${system}/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <!-- Morris -->
    <link href="${system}/static/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">

    <!-- Gritter -->
    <link href="${system}/static/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">

    <link href="${system}/static/css/animate.css" rel="stylesheet">
    <link href="${system}/static/css/style.css?v=4.1.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="${system}/static/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">

    <div class="row">
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-success pull-right">今天</span>
                    <h5>今天所有注册人数</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">
                        <c:choose>
                            <c:when test="${registerTodayUsersCount > 0 }">
                                ${registerTodayUsersCount}
                            </c:when>
                            <c:otherwise>
                                0
                            </c:otherwise>
                        </c:choose>
                        人</h1>
                    <small>到当前时间为止已注册的用户</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-info pull-right">全部</span>
                    <h5>总认证人数</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">
                        <c:choose>
                            <c:when test="${numberOfAuthenticatedUsers > 0}">
                                ${numberOfAuthenticatedUsers}
                            </c:when>
                            <c:otherwise>
                                0
                            </c:otherwise>
                        </c:choose>
                        人</h1>
                    <small>所有已经注册并认证的用户</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-primary pull-right">总额</span>
                    <h5>已放款</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">${allQuota}元</h1>
                    <small>放款总额度</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <span class="label label-danger pull-right">总额</span>
                    <h5>用户已借款额度</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins">${totalLoanAmount}元</h1>
                    <small>所有用户借款额度</small>
                </div>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>所有用户</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>账号</th>
                            <th>姓名</th>
                            <th>身份证号</th>
                            <th>银行卡号</th>
                            <th>所属银行</th>
                            <th>查看证件</th>
                            <th>地址</th>
                            <th>紧急联系人</th>
                            <th>邀请码</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="user" items="${users}">
                            <tr class="gradeA">
                                <td>${user.user_number}</td>
                                <td>${empty user.authentication.auth_user_name ? "尚未认证" : user.authentication.auth_user_name}</td>
                                <td>${empty user.authentication.auth_card_id ? "尚未认证" : user.authentication.auth_card_id}</td>
                                <td class="center">${empty user.authentication.auth_bank_number ? "尚未认证" : user.authentication.auth_bank_number}</td>
                                <td>${empty user.authentication.auth_bank_name ? "尚未认证" : user.authentication.auth_bank_name}</td>
                                <td>
                                    <span>
                                        <a href="${system}/idcard/${user.user_id}/look">点击查看照片</a>
                                    </span>
                                </td>
                                <td>
                                    <span style="cursor:pointer; color: #0e9aef;" name="address">点击查看地址</span>
                                    <span style="display: none">${empty user.authentication.auth_address ? "尚未认证" : user.authentication.auth_address}</span>
                                </td>
                                <td>${empty user.authentication.auth_contacts ? "尚未认证" : user.authentication.auth_contacts}</td>
                                <td class="center" name="code">${empty user.code ? "尚未认证" : user.code}</td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>


</div>

<!-- 全局js -->
<script src="${system}/static/js/jquery.min.js?v=2.1.4"></script>
<script src="${system}/static/js/bootstrap.min.js?v=3.3.6"></script>

<script src="${system}/static/js/alert.js"></script>

<!-- Flot -->
<script src="${system}/static/js/plugins/flot/jquery.flot.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.spline.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.resize.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.pie.js"></script>
<script src="${system}/static/js/plugins/flot/jquery.flot.symbol.js"></script>

<!-- Peity -->
<script src="${system}/static/js/plugins/peity/jquery.peity.min.js"></script>
<script src="${system}/static/js/demo/peity-demo.js"></script>

<!-- 自定义js -->
<script src="${system}/static/js/content.js?v=1.0.0"></script>


<!-- jQuery UI -->
<script src="${system}/static/js/plugins/jquery-ui/jquery-ui.min.js"></script>

<!-- Jvectormap -->
<script src="${system}/static/js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${system}/static/js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>

<!-- EayPIE -->
<script src="${system}/static/js/plugins/easypiechart/jquery.easypiechart.js"></script>

<!-- Sparkline -->
<script src="${system}/static/js/plugins/sparkline/jquery.sparkline.min.js"></script>

<!-- Sparkline demo data  -->
<script src="${system}/static/js/demo/sparkline-demo.js"></script>

<script src="${system}/static/js/plugins/jeditable/jquery.jeditable.js"></script>

<!-- Data Tables -->
<script src="${system}/static/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${system}/static/js/plugins/dataTables/dataTables.bootstrap.js"></script>

<script>
    $(document).ready(function () {
        $('.dataTables-example').dataTable();

        /* Init DataTables */
        var oTable = $('#editable').dataTable();

        /* Apply the jEditable handlers to the table */
        oTable.$('td').editable('../example_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },

            "width": "90%",
            "height": "100%"
        });


    });


    $("[name='address']").click(function () {
        swal({
            title: "地址",
            text: $(this).next().text()
        });
    });


</script>

</body>

</html>
